<form class="layui-form modal-form-box" action="__SELF__" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" value="{$vo.title}" placeholder="请输入标题" required title="请输入标题" class="layui-input"/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">链接</label>
        <div class="layui-input-block">
            <input type="text" name="link" value="{$vo.link|default='#'}" placeholder="请输入链接" required title="请输入链接" class="layui-input"/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">图片</label>
        <div class="layui-input-block">
            <input type="hidden" name="img" value="{$vo.img|default=''}" id='img'/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">打开方式</label>
        <div class="layui-input-block">
            {empty name='vo.id'}
            <input type="radio" name="target" value="_self" title="当前窗口" class="layui-input" checked/>
            <input type="radio" name="target" value="_blank" title="新窗口" class="layui-input"/>
            {else/}
            <input type="radio" name="target" value="_self" title="当前窗口" class="layui-input" {eq name='vo.target' value='_self'}checked{/eq}/>
                   <input type="radio" name="target" value="_blank" title="新窗口" class="layui-input" {eq name='vo.target' value='_blank'}checked{/eq}/>
                   {/empty}
        </div>
    </div>

    <div class="layui-form-item text-center">
        <input type="hidden" name="id" value="{$vo.id|default=''}">
        <button class="layui-btn" type="submit">保存数据</button>
        <button class="layui-btn layui-btn-primary" type="button" data-close>取消编辑</button>
    </div>
</form>
<script>
    $(function() {
        $('#img').uploadOneImage();
    });
</script>